package cn.sjxy.ssm.domain;
import java.util.Date;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;

import org.springframework.format.annotation.DateTimeFormat;


public class Employee {
	@NotBlank(message = "员工编号不能为空！")
	private String id;//员工编号
	@NotBlank(message = "员工姓名不能为空！")
	private String name;//员工姓名
	private boolean gender;//员工性别
	@NotNull(message = "日期不能为空！")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@Past(message = "员工的入职日期必须是一个过去的时间")
	private Date hireDate;//入职日期
	@NotNull(message = "工资不能为空！")
	@Min(value = 2000,message = "员工的最低工资为2000")
	private Integer salary;//员工工资
	private Department dept;//员工所属的部门
	//提供对应的setter/getter方法
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isGender() {
		return gender;
	}
	public void setGender(boolean gender) {
		this.gender = gender;
	}
	public Date getHireDate() {
		return hireDate;
	}
	public void setHireDate(Date hireDate) {
		this.hireDate = hireDate;
	}
	public Integer getSalary() {
		return salary;
	}
	public void setSalary(Integer salary) {
		this.salary = salary;
	}
	public Department getDept() {
		return dept;
	}
	public void setDept(Department dept) {
		this.dept = dept;
	}
	@Override
	public String toString() {
		return "Employee [id=" + id + ", name=" + name + ", gender=" + gender + ", hireDate=" + hireDate + ", salary="
				+ salary + ", dept=" + dept + "]";
	}
	
}
